<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-bind属性绑定style</title>
    <style>

    </style>
</head>

<body>
    <div id="app">
        <!-- :style="{key(属性名)：value(属性值)}" -->
        <h1 :style="{fontSize:'50px'}">{{message}}</h1>
        <h1 :style="{fontSize:size}">{{message}}</h1>
        <h1 :style="{fontSize:size2+'px'}">{{message}}</h1>
        <h1 :style="getstyle()">{{message}}</h1>
        <h1 :style="[style1,style2]">{{message}}</h1>

    </div>
    <script src="./vue.js"></script>
    <script>
        let app = new Vue({
            el: "#app",
            data: {
                message:"你好",
                size:'50px',
                size2:100,
                style1:{color:'red'},
                style2:{fontSize:'40px'}
                

            },
            methods: {
                getstyle(){
                    return {fontSize:this.size}
                }
            },
        })

    </script>
</body>

</html>